<?php
/**
{
    "promotionId": "INT //优惠券Id",
    "limitPrice": "DECIMAL //满多少钱可用(元)",
    "discountPrice": "DECIMAL //面值(元)",
    "uid": "INT //用户@foreign::tbl_user; @noload",
    "expire": "DATETIME //过期时间",
    "fromPromotionConfigId": "INT //优惠券来源@foreign::tbl_promotion_config; @noList; ",
    "created": "DATETIME //创建时间",
    "status": "TINYINT //状态@status; 0::未使用; 1::已使用::@admin; 2::已过期::@admin; @noload"
}
 */

class Promotion extends Base
{
    
	public $promotionId= '';//优惠券Id
	public $limitPrice= "0.0";//满多少钱可用(元)
	public $discountPrice= "0.0";//面值(元)
	public $uid= "0";//用户@foreign::tbl_user;@noload
	public $expire= NULL;//过期时间
	public $fromPromotionConfigId= "0";//优惠券来源@foreign::tbl_promotion_config;@noList;
	public $created= 'CURRENT_TIMESTAMP';//创建时间
	public $status= "0";//状态@status;0::未使用;1::已使用::@admin;2::已过期::@admin;@noload

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_promotion';
    }
    
    public  function key(){
        return 'promotionId';
    }


    
    public static  function hideField()
    {
        return [];
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'Promotion';
    }
    
    public  function field()
    {
        return array (  'promotionId' =>   array (    0 => 'INT',    1 => 11,    2 => '优惠券Id',  ),  'limitPrice' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '满多少钱可用(元)',  ),  'discountPrice' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '面值(元)',  ),  'uid' =>   array (    0 => 'INT',    1 => 11,    2 => '用户@foreign::tbl_user;@noload',  ),  'expire' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '过期时间',  ),  'fromPromotionConfigId' =>   array (    0 => 'INT',    1 => 11,    2 => '优惠券来源@foreign::tbl_promotion_config;@noList;',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间',  ),  'status' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '状态@status;0::未使用;1::已使用::@admin;2::已过期::@admin;@noload',  ),);
    }


}